package chixing.day12.homwork.work7;

import java.util.ArrayList;

public class MailAddressArrayList {
    private MailAddress addressObj;

    private static ArrayList<MailAddressArrayList> arrayList = new ArrayList<>();
    public MailAddressArrayList(){}

    public MailAddressArrayList(MailAddress addressObj) {
        this.addressObj = addressObj;
    }

    //3）add()方法：将客户的邮件地址(新建MailAddress的对象)添加到 ArrayList中
    public static void add(MailAddressArrayList e){
        arrayList.add(e);
    }
    //4）display()方法：打印客户的邮件地址。
    public static void display(MailAddressArrayList e){
        System.out.println(e);
    }


    @Override
    public String toString() {
        return "客户的邮件地址{" + addressObj +'}';
    }
}
